from django.db import models

# Create your models here.


class User(models.Model):
    username = models.CharField(max_length=32, verbose_name="用户名")
    password = models.CharField(max_length=64, verbose_name="密码")
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="注册时间" )

    def __str__(self):
        return self.username

    class Meta:
        verbose_name = "用户管理"
        verbose_name_plural = verbose_name


class Token(models.Model):
    user = models.ForeignKey(to="User", verbose_name="用户", on_delete=models.CASCADE)
    token = models.CharField(max_length=64, verbose_name="认证码")